<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<?php 
	$ci= &get_instance();
	$escort_id = intval($this->input->get('escort_id', TRUE));
	$ESCORT = $ci->escort_entity->init('id',$escort_id);
	$AGENT = getAccountUserObject();
	
	if($ESCORT->getUserId() != $AGENT->getId()){
		show_404();
	}
	//$cityArray = getCityData_ioc($country_id=$USER->getCountryId(), $state_id =$USER->getStateId(), $province_id =$USER->getProvinceId());	
	
	unset($_SESSION['totalRESULTsearch']);
	unset($_SESSION['pagination_result']);
	unset($_SESSION['backURL']);
	
	$i = 0;
?> 


<div id="content">
	<div class="escort-sheet-info">
		<div class="escort-sheet-info-top">
			<?php $this->load->view('escorts/info/media',array('ESCORT'=>$ESCORT, 'pos'=>'top') ); ?>
		</div>
		<div class="escort-sheet-info-bottom">
			<div class="escort-sheet-info-bottom-left">
				<?php $this->load->view('escorts/info/media',array('ESCORT'=>$ESCORT, 'pos'=>'bottom') ); ?>
			</div>
			<div class="escort-sheet-info-bottom-right">
				<div id="accordion">
				<?php 
					if(
						$ESCORT->getPublicSex() == 1 OR $ESCORT->getPublicSexualOrientation() == 1
						OR $ESCORT->getPublicBirthDate() == 1 OR $ESCORT->getPublicLanguageIds() == 1
						OR $ESCORT->getPublicCountry() == 1 OR $ESCORT->getPublicCountry() == 1
						OR $ESCORT->getPublicProfession() == 1
					):
				?>
					<h3 class="itemTab" rel="<?php echo $i++;?>"><a href="#"><?php echo language_translate('myzone_page_accordion_information');?></a></h3>
					<div>
						<?php $this->load->view('escorts/info/information',array('ESCORT'=>$ESCORT) ); ?>
						&nbsp;
					</div>
				<?php endif; ?>		
				
				<?php 
					if(
						$ESCORT->getPublicHair() == 1 OR $ESCORT->getPublicEye() == 1
						OR $ESCORT->getPublicHeight() == 1 OR $ESCORT->getPublicWeight() == 1
						OR $ESCORT->getPublicMeasures() == 1 
					):
				?>
					<h3 class="itemTab" rel="<?php echo $i++;?>"><a href="#"><?php echo language_translate('myzone_page_accordion_appareance');?></a></h3>
					<div>
						<?php $this->load->view('escorts/info/appareance',array('ESCORT'=>$ESCORT) ); ?>
						&nbsp;
					</div>
				<?php endif; ?>
				
				<?php 
					if(
						$ESCORT->getPublicSchedule() == 1 OR $ESCORT->getPublicWorkingCalendar() == 1
						OR $ESCORT->getPublicWorkingPlaces() == 1 OR $ESCORT->getPublicTravel() == 1
						OR $ESCORT->getPublicServeTo() == 1 OR $ESCORT->getPublicServices() == 1
					):
				?>
					<h3 class="itemTab" rel="<?php echo $i++;?>"><a href="#"><?php echo language_translate('myzone_page_accordion_services');?></a></h3>
					<div>
						<?php $this->load->view('escorts/info/services',array('ESCORT'=>$ESCORT) ); ?>
						&nbsp;
					</div>
				<?php endif; ?>
				
				<?php 
					if(
						$ESCORT->getPublicPaymentMethod() == 1 OR $ESCORT->getPublicPricingTime() == 1
						OR $ESCORT->getPublicTransportInclude() == 1 OR $ESCORT->getPublicExtras() == 1
					):
				?>
					<h3 class="itemTab" rel="<?php echo $i++;?>"><a href="#"><?php echo language_translate('myzone_page_accordion_rate');?></a></h3>
					<div>
						<?php $this->load->view('escorts/info/rates',array('ESCORT'=>$ESCORT) ); ?>
						&nbsp;
					</div>
				<?php endif; ?>
				
				<?php 
					if(
						$ESCORT->getPublicPhone() == 1 OR $ESCORT->getPublicEmail() == 1
						OR $ESCORT->getPublicAddress() == 1 OR $ESCORT->getPublicGeolocation() == 1
					):
				?>
					<h3 id="contact-info-tab" class="itemTab" rel="<?php echo $i++;?>"><a href="#"><?php echo language_translate('myzone_page_accordion_contact');?></a></h3>
					<div id="contact-info">
						<?php $this->load->view('escorts/info/contact',array('ESCORT'=>$ESCORT) ); ?>
						&nbsp;
					</div>
				<?php endif; ?>	
				
				<?php 
					if(
						$ESCORT->getReceiveMessage() == 1 
					):
				?>
					<h3 class="itemTab" rel="<?php echo $i++;?>"><a href="#"><?php echo language_translate('myzone_page_accordion_contact_message');?></a></h3>
					<div id="contact-info">
						<?php $this->load->view('escorts/info/message',array('ESCORT'=>$ESCORT) ); ?>
						&nbsp;
					</div>
				<?php endif; ?>		
				</div>
			</div>
			<div class="clear"></div>
			<div class="escort-sheet-info-bottom-extra">
				<?php $this->load->view('banner/profile_banner',array('pos'=>'agent') ); ?>
			</div>
		</div>
	</div>
</div>
 	
<div class="bottom-content-wrapper">
	<div class="bottom-content"></div>
</div>





<script type="text/javascript">
	$(document).ready(function() { 
		$('.introduction-text .ui-icon-closethick').click(function(){
			$('.introduction-text').hide();
			$('#open-introduction-text').show();
		}); 
		$('#open-introduction-text').click(function(){
			$('.introduction-text').show();
			$('#open-introduction-text').hide();
		}); 
		$('.ui-accordion-content').height('auto');
		
		$('.escort-sheet-info-phone').bind('click',function(){
			$( "#accordion" ).accordion({ active: parseInt( $('#contact-info-tab').attr('rel') ) });
			document.location = '#contact-info-tab';
		});
		
		$('.background-images-slideshow .carousel-pagination a').bind('click',function(){
			changeLayoutSlideshow();
		});
	});	
	
	google.setOnLoadCallback(function() {
		changeLayoutSlideshow();
	});
	
	function changeLayoutSlideshow(){
		$idArray = [];
		$('.background-images-slideshow ul li').each(function(i,o){
			$idArray.push($(this).attr('rel'));
		});
		$i = 0;$j = 0;
		$('.background-images-slideshow .carousel-pagination a').each(function(i,o){
			if($(this).attr('class') == 'active'){
				$j = $i;
			}
			$i++;
		}); 
		if($('.background-images-slideshow li').length != 0){
			$media_id=$idArray[$j]; 
			$minheight = $('.background-images-slideshow li[rel="'+$media_id+'"]').children().height();
			$minheight = $minheight > 180 ? 575 : 174;
			$('.background-images-slideshow .carousel-wrap').height($minheight); 
			$('.background-images-slideshow .carousel-wrap ul li').height($minheight); 
			$('.escort-sheet-info-top').css({'min-height':$minheight});
			$('.background-images-slideshow-wrapper,.background-images-slideshow').height($minheight);
		}
	}
</script>